#include <am.h>
void __am_timer_init() {
}
static inline uint32_t inl(uintptr_t addr) { return *(volatile uint32_t *)addr; }
void __am_timer_uptime(AM_TIMER_UPTIME_T *uptime) {
  uptime->us = (uint64_t)inl(RTC_ADDR)+((uint64_t)inl(RTC_ADDR+4)<<32uLL);
  // uint32_t temp1;
  // temp1 = *(volatile uint64_t *)0xa0000048;
  // // temp2 = *(volatile uint32_t *)(0xa0000048+4);
  // uptime->us = temp1;

}

void __am_timer_rtc(AM_TIMER_RTC_T *rtc) {
  rtc->second = 0;
  rtc->minute = 0;
  rtc->hour   = 0;
  rtc->day    = 0;
  rtc->month  = 0;
  rtc->year   = 1900;
}
